package com.rickpan.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * MinIO 配置属性
 */
@Component
@ConfigurationProperties(prefix = "app.storage.minio")
public class MinIOProperties {
    
    /**
     * MinIO 服务端点
     */
    private String endpoint = "http://localhost:9000";
    
    /**
     * 访问密钥
     */
    private String accessKey = "minioadmin";
    
    /**
     * 秘密密钥
     */
    private String secretKey = "minioadmin";
    
    /**
     * 存储桶名称
     */
    private String bucketName = "rickpan";
    
    /**
     * 区域
     */
    private String region = "us-east-1";
    
    /**
     * 预签名URL默认有效期（秒）
     */
    private int defaultUrlExpiration = 3600; // 1小时
    
    /**
     * 预览URL默认有效期（秒）
     */
    private int previewUrlExpiration = 1800; // 30分钟
    
    // Getters and Setters
    
    public String getEndpoint() {
        return endpoint;
    }
    
    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }
    
    public String getAccessKey() {
        return accessKey;
    }
    
    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }
    
    public String getSecretKey() {
        return secretKey;
    }
    
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
    
    public String getBucketName() {
        return bucketName;
    }
    
    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }
    
    public String getRegion() {
        return region;
    }
    
    public void setRegion(String region) {
        this.region = region;
    }
    
    public int getDefaultUrlExpiration() {
        return defaultUrlExpiration;
    }
    
    public void setDefaultUrlExpiration(int defaultUrlExpiration) {
        this.defaultUrlExpiration = defaultUrlExpiration;
    }
    
    public int getPreviewUrlExpiration() {
        return previewUrlExpiration;
    }
    
    public void setPreviewUrlExpiration(int previewUrlExpiration) {
        this.previewUrlExpiration = previewUrlExpiration;
    }
}
